package com.alkaid.user.service;

import com.alkaid.commons.entity.Authority;
import com.alkaid.commons.ex.AuthorityInsertException;
import com.alkaid.commons.ex.AuthorityNotFoundException;

import java.util.List;

/**
 * @author Kylin
 */
public interface AuthorityService {
    /**
     * 通过用户ID获取权限列表
     *
     * @param userId the user id
     * @return the authorities by user id
     * @throws AuthorityNotFoundException 未查询到权限
     */
    List<Authority> getAuthoritiesByUserId(Long userId) throws AuthorityNotFoundException;

    /**
     * 添加权限 - 注册
     *
     * @param userId the user id
     * @param username the username
     * @throws AuthorityInsertException the authority insert exception
     */
    void addAuthorityForReg(Long userId, String username) throws AuthorityInsertException;
}
